package com.nbsaas.boot.quartz.rest.convert;

import com.nbsaas.boot.quartz.data.entity.SchedulingTask;
import com.nbsaas.boot.quartz.api.domain.simple.SchedulingTaskSimple;

import com.nbsaas.boot.rest.api.Converter;

/**
 * 定时任务-列表对象转换器
 */

public class SchedulingTaskSimpleConvert implements Converter<SchedulingTaskSimple, SchedulingTask> {


    @Override
    public SchedulingTaskSimple convert(SchedulingTask source) {
        SchedulingTaskSimple result = new SchedulingTaskSimple();

        result.setAliasName(source.getAliasName());
        result.setRecordType(source.getRecordType());
        result.setRequestMethod(source.getRequestMethod());
        result.setRemark(source.getRemark());
        result.setType(source.getType());
        result.setIsSync(source.getIsSync());
        result.setAddDate(source.getAddDate());
        result.setUrl(source.getUrl());
        result.setContent(source.getContent());
        result.setCronExpression(source.getCronExpression());
        result.setRequestBody(source.getRequestBody());
        result.setName(source.getName());
        result.setRequestHeader(source.getRequestHeader());
        result.setId(source.getId());
        result.setContentType(source.getContentType());
        result.setLastDate(source.getLastDate());


        return result;
    }

}